package day8.pack2;

/**
 * 货车
 *
 */
public class Test {
    public static void main(String[] args) {
//       新增货车 租赁50吨,5天 。吨位 50块/吨天
        MotoVehicle[] cars = new MotoVehicle[] {
                new Car(CarEnum.BMW550I.getCarName(), "赣AM1234"),
                new Car(CarEnum.BMW550I.getCarName(), "赣AM3334"),
                new Car(CarEnum.BKSW.getCarName(), "赣AK1212"),
                new Bus(32, "赣AL1211")
        };
        int sum = 0;
        for (int i = 0; i < cars.length; i++) {
            MotoVehicle motoVehicle = cars[i];
            sum += motoVehicle.calcRent(5);
        }
        System.out.println(sum);




    }
}
